package com.neuedu.his.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neuedu.his.entity.PrescriptionDetailed;
import com.neuedu.his.service.PrescriptionDetailedService;

@RestController
@RequestMapping("/prescriptiondetailed")
public class PrescriptionDetailedController {
	
	@Autowired
	private PrescriptionDetailedService service;
	
	@RequestMapping("/selectAll")
	// http://localhost:8088/prescriptiondetailed/selectAll
	public List<PrescriptionDetailed> selectAll(PrescriptionDetailed u) {
		return service.selectAll(u);
	}
	
	@RequestMapping("/selectById")
	// http://localhost:8088/prescriptiondetailed/selectById?id=1
	public List<PrescriptionDetailed> selectById(PrescriptionDetailed u) {
		return service.selectById(u);
	}
	
	@RequestMapping("/prescriptionselectById")
	// http://localhost:8088/prescriptiondetailed/prescriptionselectById?prescriptionid=1
	public List<PrescriptionDetailed> prescriptionselectById(PrescriptionDetailed u) {
		return service.prescriptionselectById(u);
	}
	
	@RequestMapping("/add")
	// http://localhost:8088/prescriptiondetailed/add?prescriptionid=55&drugsid=22&drugsusage=口服&dosage=2g&frequency=1日2次&amount=5&state=6
	public int add(PrescriptionDetailed u) {
		return service.add(u);
	}

	@RequestMapping("/delete")
	// http://localhost:8088/prescriptiondetailed/delete?id=29
	public int delete(PrescriptionDetailed u) {
		return service.delete(u);
	}
}
